﻿using ZeroBlog.Application.Tests.Dtos.In;
using ZeroBlog.Core.Domains.TestAggregate;
using ZeroBlog.Core.DomainServices.Tests;
using ZeroSum.DependencyInjection.Attributes;
using ZeroSum.Extend.Mapper.Extensions;

namespace ZeroBlog.Application.Tests
{
    [Register]
    public class TestApplicationService : ITestApplicationService
    {
        private readonly ITestDomainService _domainService;

        public TestApplicationService(ITestDomainService domainService)
        {
            _domainService = domainService;
        }

        public async Task Add(AddTestDto dto)
        {
            await _domainService.Add(dto.MapTo<Test>());
        }
    }
}
